package com.mykt.fallback;


import com.mykt.baseResult.RespondsResult;
import com.mykt.domain.SystemLoginLog;
import com.mykt.domain.SystemUser;
import com.mykt.domain.log.SystemOperLog;
import com.mykt.exception.MyServiceException;
import com.mykt.system.RemoteUserService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class RemoteUserFallback implements FallbackFactory<RemoteUserService> {

    @Override
    public RemoteUserService create(Throwable throwable)
    {
        return new RemoteUserService()
        {
            @Override
            public RespondsResult<SystemUser> info(String userName,String source)
            {
                throw new MyServiceException("feign服务调用失败");
            }

            @Override
            public RespondsResult add(SystemLoginLog logininfor,String source) {
                throw new MyServiceException("feign服务调用失败");
            }

            @Override
            public RespondsResult write(SystemOperLog operLog, String source) {
                throw new MyServiceException("feign服务调用失败");
            }
        };
    }

}

